package com.wenyl.juc.thread.callback;


/**
 * @author Swimming Dragon
 * @description: TODO
 * @date 2024年11月05日 22:43
 */
public class Server {
    public void getMsg(Callback callback, String msg){
        System.out.println("服务端获取消息=="+msg);
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        System.out.println("处理成功，返回200");
        // 处理完消息，调用客户端回调
        callback.process(200);
    }
}
